<include file="Public/head" title="编辑订单"/>
<include file="Public/back_head"/>
<form id="dataForm">
<!-- 订单基本数据 -->
<input type="hidden" name="user_id" value="{$user.id}"/>
<input type="hidden" name="goods_id" value="{$goods_info.id}"/>
<input type="hidden" name="spec_id" value="{$spec_info.id}"/>
<input type="hidden" name="order_type" value="{$goods_info.type}"/>
<input type="hidden" name="order_num" value="{$basic_order.order_num|default=1}"/>
<input type="hidden" name="order_price" value="{$basic_order.order_price|default=0}"/>
<input type="hidden" name="address_id" value="{$address_info.id}"/>
<input type="hidden" name="service" value="{$basic_order.service|default=1}"/>
<!-- 订单基本数据 -->
<div class="main">
	<if condition="$address_info">
	    <a href="{:U('User/address')}">
	        <div class="addrecipient_url">
	            <div class="top"><span>{$address_info.name}</span><span>{$address_info.phone}</span><if condition="$address_info.is_default eq '1'"><i>默认</i></if></div>
	            <div class="bottom"><i class="iconfont icon-weizhi1"></i>{$address_info.area}{$address_info.address}<i class="iconfont icon-zuoyoujiantou2"></i></div>
	            <img src="__PUBLIC__/home/image/border_01.png" alt="" class="border_01">
	        </div>
	    </a>
    <else/>
	    <a href="{:U('User/address_save')}">
		    <div class="addrecipient_url">
		        <div class="addrecip"><i class="iconfont icon-add"></i>添加收货地址 <i class="iconfont icon-zuoyoujiantou2"></i></div>
		        <img src="__PUBLIC__/home/image/border_01.png" alt="" class="border_01">
		    </div>
	    </a>
    </if>
    <div class="select_shop_info clear">
        <img src="{$goods_info.goods_logo}" alt="">
        <div class="select_shop_right">
            <div class="title">{$goods_info.goods_name}</div>
            <div class="show">{$goods_info.profile}</div>
            <div class="money clear"><i class="iconfont icon-jiage-copy"></i>
            <if condition="$basic_order.service eq '1'">
            {$goods_info.price} 
            <elseif condition="$basic_order.service eq '2'"/>
            {$goods_info.vip_price} 
            <elseif condition="$basic_order.service eq '3'"/>
            {$goods_info.per_first_price} 
            </if>
            <span>X {$basic_order.order_num|default=1}</span></div>
            <if condition="$goods_info.type eq '1'"><div class="type">颜色:  {$spec_info.color}</div></if>
        </div>
    </div>
    <if condition="$basic_order.service eq '2'">
    <!--VIP类-->
    <div class="vip_service">
        <div class="title">已选服务 <span>Vip通道</span></div>
        <div class="show">VIP通道专享车身个性昵称雕刻</div>
        <label for="">
            <input type="text" name="vip_note" placeholder="请输入想要雕刻的姓名/昵称，不超过10个汉字" maxlength="10">
        </label>
    </div>
    <!--VIP类-->
    </if>
    <if condition="$basic_order.service eq '3'">
    <!--按天付类-->
    <div class="vip_service">
    	<input type="hidden" name="deposit" value="{$global_info.deposit|default=0}"/>
        <div class="title">已选服务 <span>按天付</span></div>
        <div class="show">首付金额￥{$goods_info.per_first_price|default=0}，每天还款￥{$goods_info.per_price|default=0}，共还{$goods_info.per_days|default=0}天</div>
        <div class="show2">押金￥{$global_info.deposit|default=0}</div>
    </div>
    <!--按天付类-->
    </if>
    <div class="express_info">
        <div class="info">
            <span>发货说明</span>您下单后，我们会在24小时内发货，请放心下单
        </div>
        <div class="info">
            <span>快递说明</span>一般采用顺丰快递发货，并且包邮
        </div>
    </div>
</div>
</form>
<div class="place_order clear">
    <div class="place_order_count">合计 <i class="iconfont icon-jiage-copy"></i><span>{$basic_order['order_price']|default=0}</span>
    </div>
    <div class="place_order_btn">提交订单</div>
</div>
<script type="text/javascript">
    (function () {
        //       实名认证
//         $(".place_order_btn").click(function () {
//             Establish_certification("温馨提示","您尚未实名认证，无法添加收地址","暂不认证","立即认证","基本信息-实名认证.html");
//         });
//         $("body").on("click",".Position_close",function () {
//             $(".certification").hide();
//         });
//         $("body").on("click",".b1",function () {
//             $(".certification").hide();
//         });
		var is_sub = false;
		$('.place_order_btn').click(function(){
			if(is_sub){
    			return false;
    		}else{
    			is_sub = true;
    		}
			$.post("{:U('sub_order')}",$('#dataForm').serializeArray(),function(data){
				layer.msg(data.info);
        		if(data.status == '0') is_sub = false;
        		if(data.url != '') setTimeout("location.href='"+data.url+"'",1000);
			});
		});
    })(jQuery)
</script>
</body>
</html>